import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import axios from 'axios'
import elementUI from 'element-ui'
import '../node_modules/element-ui/lib/theme-chalk/index.css'
import TreeTable from 'vue-table-with-tree-grid'
import VueQuillEditor from 'vue-quill-editor'
//适用echarts绘图
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
//进度条效果
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'



// require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
Vue.config.productionTip = false
Vue.prototype.$http=axios
Vue.use(elementUI)
// 配置请求根路径  
axios.defaults.baseURL="http://timemeetyou.com:8889/api/private/v1/"     
axios.interceptors.request.use(config=>{
  NProgress.start();
  config.headers.Authorization=window.sessionStorage.getItem("token")
  return config
})  
//进度条
axios.interceptors.response.use(config=>{
  NProgress.done();
  return config
})







//深拷贝lodash
// Load the full build.
var _ = require('lodash');
// Load the core build.
var _ = require('lodash/core');
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
var fp = require('lodash/fp');
 
// Load method categories.
var array = require('lodash/array');
var object = require('lodash/fp/object');
 
// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
var at = require('lodash/at');
var curryN = require('lodash/fp/curryN');




// https://www.liulongbin.top:8888/api/private/v1/
Vue.component('tree-table',TreeTable)    

Vue.filter('dateFromate',function(originVal){
 const dt=new Date(originVal);
 const y=dt.getFullYear();
 const m =(dt.getMonth()+1+'').padStart(2,'0');
 const d=(dt.getDate()+1+'').padStart(2,'0');
const h=(dt.getHours()+1+'').padStart(2,'0');
const mm=(dt.getMinutes()+1+'').padStart(2,'0');
const ss=(dt.getSeconds()+1+'').padStart(2,'0');
return `${y}-${m}-${d}-${h}:${mm}:${ss}:`

})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
